package Demo7;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Demo {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context =
                new AnnotationConfigApplicationContext(Person.class);
        System.out.println("容器创建完成...");
        System.out.println("准备获取对象");
        Person person = context.getBean(Person.class);
        System.out.println("获取完毕");
        System.out.println(person.getName());
        context.close();
        System.out.println("容器关闭");
    }
}
